package com.lkm.app_ui.m.Imple.display_second;

import android.content.Context;
import android.hardware.display.DisplayManager;
import android.view.Display;

public class DisplayUtil {
    public static Display getDisplay(Context context) {
        Display[] displays = getDisplays(context);
        if (displays == null || displays.length <= 0) {
            return null;
        }
        return displays[0];
    }

    public static Display[] getDisplays(Context context) {
        return getDisplays(context, "android.hardware.display.category.PRESENTATION");
    }

    public static Display[] getDisplays(Context context, String category) {
        return ((DisplayManager) context.getApplicationContext().getSystemService(Context.DISPLAY_SERVICE)).getDisplays(category);
    }
}
